//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_posbehind2.sqf"
#include "x_setup.sqf"

private ["_p1", "_p2", "_dist", "_dir", "_dirn", "_x1", "_y1"];
PARAMS_2(_p1,_p2);
_dist = (random 1800) max 1500;
_dir = [_p1, _p2] call FUNC(DirTo);
_dirn = _dir + 180;
_x1 = (_p2 select 0) - (_dist * sin _dirn);
_y1 = (_p2 select 1) - (_dist * cos _dirn);
#ifdef __DEBUG__
if (str(markerPos QUOTE(posbehind2_marker)) != "[0,0,0]") then {deleteMarkerLocal QUOTE(posbehind2_marker)};
[QUOTE(posbehind2_marker),[_x1,_y1],"ICON","ColorRed",[1.3,1.3],"Eny Camp",0,"mil_dot"] call FUNC(CreateMarkerLocal);
#endif
[[_x1,_y1,0], _dirn, _dist];